<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: DC Measurement Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__adcmic__functions__dc.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">DC Measurement Functions<div class="ingroups"><a class="el" href="group__group__adcmic.html">ADCMic       (Delta-Sigma ADC with PDM microphone support)</a> &raquo; <a class="el" href="group__group__adcmic__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>This set of functions is for DC measurement mode. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gac09ab66d5d8fad6d1f7b24b18fcba8f2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__adcmic__functions__dc.html#gac09ab66d5d8fad6d1f7b24b18fcba8f2">Cy_ADCMic_SelectDcChannel</a> (<a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> *base, <a class="el" href="group__group__adcmic__enums.html#ga152671e552d2117bcc613e7021ce8514">cy_en_adcmic_dc_channel_t</a> channel)</td></tr>
<tr class="memdesc:gac09ab66d5d8fad6d1f7b24b18fcba8f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the specified DC measurement channel.  <a href="#gac09ab66d5d8fad6d1f7b24b18fcba8f2">More...</a><br /></td></tr>
<tr class="separator:gac09ab66d5d8fad6d1f7b24b18fcba8f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0bfff648caad3604684019c82b740e8d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__adcmic__enums.html#gaf46b38a86a6fbdfee98d9b37ae44a154">cy_en_adcmic_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__adcmic__functions__dc.html#ga0bfff648caad3604684019c82b740e8d">Cy_ADCMic_IsEndConversion</a> (<a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> *base, <a class="el" href="group__group__adcmic__enums.html#gaef8552fb17411ed60788242595742771">cy_en_adcmic_return_mode_t</a> retMode)</td></tr>
<tr class="memdesc:ga0bfff648caad3604684019c82b740e8d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediately return the status of the conversion or does not return (blocking) until the conversion completes, depending on the retMode parameter.  <a href="#ga0bfff648caad3604684019c82b740e8d">More...</a><br /></td></tr>
<tr class="separator:ga0bfff648caad3604684019c82b740e8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad6e104e180e9e3c8ef195d55eddec82b"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__adcmic__functions__dc.html#gad6e104e180e9e3c8ef195d55eddec82b">Cy_ADCMic_GetDcResult</a> (<a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> *base)</td></tr>
<tr class="memdesc:gad6e104e180e9e3c8ef195d55eddec82b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the DC conversion result from the CIC status register.  <a href="#gad6e104e180e9e3c8ef195d55eddec82b">More...</a><br /></td></tr>
<tr class="separator:gad6e104e180e9e3c8ef195d55eddec82b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga463bc0f38f4c35860bc6773e04f0afed"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__adcmic__functions__dc.html#ga463bc0f38f4c35860bc6773e04f0afed">Cy_ADCMic_SetDcOffset</a> (int16_t offset, <a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a> *context)</td></tr>
<tr class="memdesc:ga463bc0f38f4c35860bc6773e04f0afed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the offset value for DC measurement calibration.  <a href="#ga463bc0f38f4c35860bc6773e04f0afed">More...</a><br /></td></tr>
<tr class="separator:ga463bc0f38f4c35860bc6773e04f0afed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga914afbd1aa02c7a38b89f3e59dc4851f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__adcmic__functions__dc.html#ga914afbd1aa02c7a38b89f3e59dc4851f">Cy_ADCMic_SetDcGain</a> (int16_t gain, <a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a> *context)</td></tr>
<tr class="memdesc:ga914afbd1aa02c7a38b89f3e59dc4851f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the gain value for DC measurement calibration.  <a href="#ga914afbd1aa02c7a38b89f3e59dc4851f">More...</a><br /></td></tr>
<tr class="separator:ga914afbd1aa02c7a38b89f3e59dc4851f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa4e4fed5d3528ca54a9ca8d6e67bb597"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__adcmic__functions__dc.html#gaa4e4fed5d3528ca54a9ca8d6e67bb597">Cy_ADCMic_CountsTo_mVolts</a> (int16_t adcCounts, <a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a> const *context)</td></tr>
<tr class="memdesc:gaa4e4fed5d3528ca54a9ca8d6e67bb597"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the ADC output to millivolts as an int16.  <a href="#gaa4e4fed5d3528ca54a9ca8d6e67bb597">More...</a><br /></td></tr>
<tr class="separator:gaa4e4fed5d3528ca54a9ca8d6e67bb597"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0f53cbec4f5114dae34c82dccd38a268"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__adcmic__functions__dc.html#ga0f53cbec4f5114dae34c82dccd38a268">Cy_ADCMic_CountsTo_uVolts</a> (int16_t adcCounts, <a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a> const *context)</td></tr>
<tr class="memdesc:ga0f53cbec4f5114dae34c82dccd38a268"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the ADC output to microvolts as an int32.  <a href="#ga0f53cbec4f5114dae34c82dccd38a268">More...</a><br /></td></tr>
<tr class="separator:ga0f53cbec4f5114dae34c82dccd38a268"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaae64c9203bf528b6f7f6f7edb5d25340"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__adcmic__functions__dc.html#gaae64c9203bf528b6f7f6f7edb5d25340">Cy_ADCMic_CountsTo_Volts</a> (int16_t adcCounts, <a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a> const *context)</td></tr>
<tr class="memdesc:gaae64c9203bf528b6f7f6f7edb5d25340"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the ADC output to volts as a float.  <a href="#gaae64c9203bf528b6f7f6f7edb5d25340">More...</a><br /></td></tr>
<tr class="separator:gaae64c9203bf528b6f7f6f7edb5d25340"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gac09ab66d5d8fad6d1f7b24b18fcba8f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac09ab66d5d8fad6d1f7b24b18fcba8f2">&#9670;&nbsp;</a></span>Cy_ADCMic_SelectDcChannel()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_ADCMic_SelectDcChannel </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__adcmic__enums.html#ga152671e552d2117bcc613e7021ce8514">cy_en_adcmic_dc_channel_t</a>&#160;</td>
          <td class="paramname"><em>channel</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the specified DC measurement channel. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the hardware ADCMic block.</td></tr>
    <tr><td class="paramname">channel</td><td>The DC measurement channel <a class="el" href="group__group__adcmic__enums.html#ga152671e552d2117bcc613e7021ce8514">cy_en_adcmic_dc_channel_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This function is useful for DC measurement only.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Initialize ADCMic for the DC measurement: */</span></div><div class="line">    uint16_t data = 0U;</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__adcmic__enums.html#ggaf46b38a86a6fbdfee98d9b37ae44a154a5372a55427aca75e12013c2bb7844157">CY_ADCMIC_SUCCESS</a> != <a class="code" href="group__group__adcmic__functions__basic.html#ga3a8b909addc754b68cd7373e63f1fdbc">Cy_ADCMic_Init</a>(MXS40ADCMIC0, &amp;config, <a class="code" href="group__group__adcmic__enums.html#gga0c6998d15b030e746482c263d62569c4a38fa43ff6cb50910002588af0a70005e">CY_ADCMIC_DC</a>))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Something went wrong, insert error handling here */</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <a class="code" href="group__group__adcmic__functions__dc.html#gac09ab66d5d8fad6d1f7b24b18fcba8f2">Cy_ADCMic_SelectDcChannel</a>(MXS40ADCMIC0, <a class="code" href="group__group__adcmic__enums.html#gga152671e552d2117bcc613e7021ce8514a7882eae286d66378d954d9743ce1146d">CY_ADCMIC_GPIO0</a>); <span class="comment">/* Switch to the GPIO_0 */</span></div><div class="line">    <a class="code" href="group__group__adcmic__functions__basic.html#ga722d964ea6930fcd47b8e02b329669ea">Cy_ADCMic_Enable</a>(MXS40ADCMIC0); <span class="comment">/* Enable the block operation */</span></div><div class="line">    <a class="code" href="group__group__adcmic__functions__dc.html#ga0bfff648caad3604684019c82b740e8d">Cy_ADCMic_IsEndConversion</a>(MXS40ADCMIC0, <a class="code" href="group__group__adcmic__enums.html#ggaef8552fb17411ed60788242595742771a4c92d7cf983ec3bfe5e2393059444b21">CY_ADCMIC_WAIT_FOR_RESULT</a>); <span class="comment">/* Wait the conversion is done */</span></div><div class="line">    <a class="code" href="group__group__adcmic__functions__basic.html#ga70979a0967644dec401b37a2a29b2481">Cy_ADCMic_Disable</a>(MXS40ADCMIC0); <span class="comment">/* Stop the operation */</span></div><div class="line">    data = <a class="code" href="group__group__adcmic__functions__dc.html#gad6e104e180e9e3c8ef195d55eddec82b">Cy_ADCMic_GetDcResult</a>(MXS40ADCMIC0); <span class="comment">/* Get the result */</span></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga0bfff648caad3604684019c82b740e8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0bfff648caad3604684019c82b740e8d">&#9670;&nbsp;</a></span>Cy_ADCMic_IsEndConversion()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__adcmic__enums.html#gaf46b38a86a6fbdfee98d9b37ae44a154">cy_en_adcmic_status_t</a> Cy_ADCMic_IsEndConversion </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__adcmic__enums.html#gaef8552fb17411ed60788242595742771">cy_en_adcmic_return_mode_t</a>&#160;</td>
          <td class="paramname"><em>retMode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Immediately return the status of the conversion or does not return (blocking) until the conversion completes, depending on the retMode parameter. </p>
<p>In blocking mode, there is a time out of about 10 seconds for a CPU speed of 100 MHz.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">retMode</td><td>A value of the enum <a class="el" href="group__group__adcmic__enums.html#gaef8552fb17411ed60788242595742771">cy_en_adcmic_return_mode_t</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li><a class="el" href="group__group__adcmic__enums.html#ggaf46b38a86a6fbdfee98d9b37ae44a154a5372a55427aca75e12013c2bb7844157">CY_ADCMIC_SUCCESS</a> : the last conversion is complete</li>
<li><a class="el" href="group__group__adcmic__enums.html#ggaf46b38a86a6fbdfee98d9b37ae44a154af1d25adc53f2dd2c9e8803f093847dce">CY_ADCMIC_CONVERSION_NOT_COMPLETE</a> : the conversion has not completed</li>
<li><a class="el" href="group__group__adcmic__enums.html#ggaf46b38a86a6fbdfee98d9b37ae44a154a5dfdfd96e113731b9aaf162262d57a46">CY_ADCMIC_TIMEOUT</a> : the watchdog timer has expired in blocking mode</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Side Effects</dt><dd>This function reads the end of conversion status interrupt bit and clears it after.</dd></dl>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="group__group__adcmic__enums.html#ggaef8552fb17411ed60788242595742771a4c92d7cf983ec3bfe5e2393059444b21">CY_ADCMIC_WAIT_FOR_RESULT</a> return modes are not recommended for use in RTOS environment.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Initialize ADCMic for the DC measurement: */</span></div><div class="line">    uint16_t data = 0U;</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__adcmic__enums.html#ggaf46b38a86a6fbdfee98d9b37ae44a154a5372a55427aca75e12013c2bb7844157">CY_ADCMIC_SUCCESS</a> != <a class="code" href="group__group__adcmic__functions__basic.html#ga3a8b909addc754b68cd7373e63f1fdbc">Cy_ADCMic_Init</a>(MXS40ADCMIC0, &amp;config, <a class="code" href="group__group__adcmic__enums.html#gga0c6998d15b030e746482c263d62569c4a38fa43ff6cb50910002588af0a70005e">CY_ADCMIC_DC</a>))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Something went wrong, insert error handling here */</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <a class="code" href="group__group__adcmic__functions__dc.html#gac09ab66d5d8fad6d1f7b24b18fcba8f2">Cy_ADCMic_SelectDcChannel</a>(MXS40ADCMIC0, <a class="code" href="group__group__adcmic__enums.html#gga152671e552d2117bcc613e7021ce8514a7882eae286d66378d954d9743ce1146d">CY_ADCMIC_GPIO0</a>); <span class="comment">/* Switch to the GPIO_0 */</span></div><div class="line">    <a class="code" href="group__group__adcmic__functions__basic.html#ga722d964ea6930fcd47b8e02b329669ea">Cy_ADCMic_Enable</a>(MXS40ADCMIC0); <span class="comment">/* Enable the block operation */</span></div><div class="line">    <a class="code" href="group__group__adcmic__functions__dc.html#ga0bfff648caad3604684019c82b740e8d">Cy_ADCMic_IsEndConversion</a>(MXS40ADCMIC0, <a class="code" href="group__group__adcmic__enums.html#ggaef8552fb17411ed60788242595742771a4c92d7cf983ec3bfe5e2393059444b21">CY_ADCMIC_WAIT_FOR_RESULT</a>); <span class="comment">/* Wait the conversion is done */</span></div><div class="line">    <a class="code" href="group__group__adcmic__functions__basic.html#ga70979a0967644dec401b37a2a29b2481">Cy_ADCMic_Disable</a>(MXS40ADCMIC0); <span class="comment">/* Stop the operation */</span></div><div class="line">    data = <a class="code" href="group__group__adcmic__functions__dc.html#gad6e104e180e9e3c8ef195d55eddec82b">Cy_ADCMic_GetDcResult</a>(MXS40ADCMIC0); <span class="comment">/* Get the result */</span></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gad6e104e180e9e3c8ef195d55eddec82b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad6e104e180e9e3c8ef195d55eddec82b">&#9670;&nbsp;</a></span>Cy_ADCMic_GetDcResult()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE int16_t Cy_ADCMic_GetDcResult </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_m_x_s40_a_d_c_m_i_c___type.html">MXS40ADCMIC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the DC conversion result from the CIC status register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to the hardware ADCMic block.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The signed DC conversion result.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Initialize ADCMic for the DC measurement: */</span></div><div class="line">    uint16_t data = 0U;</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__adcmic__enums.html#ggaf46b38a86a6fbdfee98d9b37ae44a154a5372a55427aca75e12013c2bb7844157">CY_ADCMIC_SUCCESS</a> != <a class="code" href="group__group__adcmic__functions__basic.html#ga3a8b909addc754b68cd7373e63f1fdbc">Cy_ADCMic_Init</a>(MXS40ADCMIC0, &amp;config, <a class="code" href="group__group__adcmic__enums.html#gga0c6998d15b030e746482c263d62569c4a38fa43ff6cb50910002588af0a70005e">CY_ADCMIC_DC</a>))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Something went wrong, insert error handling here */</span></div><div class="line">    }</div><div class="line"></div><div class="line">    <a class="code" href="group__group__adcmic__functions__dc.html#gac09ab66d5d8fad6d1f7b24b18fcba8f2">Cy_ADCMic_SelectDcChannel</a>(MXS40ADCMIC0, <a class="code" href="group__group__adcmic__enums.html#gga152671e552d2117bcc613e7021ce8514a7882eae286d66378d954d9743ce1146d">CY_ADCMIC_GPIO0</a>); <span class="comment">/* Switch to the GPIO_0 */</span></div><div class="line">    <a class="code" href="group__group__adcmic__functions__basic.html#ga722d964ea6930fcd47b8e02b329669ea">Cy_ADCMic_Enable</a>(MXS40ADCMIC0); <span class="comment">/* Enable the block operation */</span></div><div class="line">    <a class="code" href="group__group__adcmic__functions__dc.html#ga0bfff648caad3604684019c82b740e8d">Cy_ADCMic_IsEndConversion</a>(MXS40ADCMIC0, <a class="code" href="group__group__adcmic__enums.html#ggaef8552fb17411ed60788242595742771a4c92d7cf983ec3bfe5e2393059444b21">CY_ADCMIC_WAIT_FOR_RESULT</a>); <span class="comment">/* Wait the conversion is done */</span></div><div class="line">    <a class="code" href="group__group__adcmic__functions__basic.html#ga70979a0967644dec401b37a2a29b2481">Cy_ADCMic_Disable</a>(MXS40ADCMIC0); <span class="comment">/* Stop the operation */</span></div><div class="line">    data = <a class="code" href="group__group__adcmic__functions__dc.html#gad6e104e180e9e3c8ef195d55eddec82b">Cy_ADCMic_GetDcResult</a>(MXS40ADCMIC0); <span class="comment">/* Get the result */</span></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga463bc0f38f4c35860bc6773e04f0afed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga463bc0f38f4c35860bc6773e04f0afed">&#9670;&nbsp;</a></span>Cy_ADCMic_SetDcOffset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_ADCMic_SetDcOffset </td>
          <td>(</td>
          <td class="paramtype">int16_t&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the offset value for DC measurement calibration. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">offset</td><td>The offset value.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure <a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga914afbd1aa02c7a38b89f3e59dc4851f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga914afbd1aa02c7a38b89f3e59dc4851f">&#9670;&nbsp;</a></span>Cy_ADCMic_SetDcGain()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_ADCMic_SetDcGain </td>
          <td>(</td>
          <td class="paramtype">int16_t&#160;</td>
          <td class="paramname"><em>gain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the gain value for DC measurement calibration. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">gain</td><td>The gain value.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure <a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaa4e4fed5d3528ca54a9ca8d6e67bb597"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa4e4fed5d3528ca54a9ca8d6e67bb597">&#9670;&nbsp;</a></span>Cy_ADCMic_CountsTo_mVolts()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int16_t Cy_ADCMic_CountsTo_mVolts </td>
          <td>(</td>
          <td class="paramtype">int16_t&#160;</td>
          <td class="paramname"><em>adcCounts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a> const *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Convert the ADC output to millivolts as an int16. </p>
<p>For example, if the ADC measured 0.534 volts, the return value would be 534. The calculation of voltage depends on the DC range. The equation used is: </p><pre class="fragment">mV = (RawCounts - Offset) * 1000 / Gain
</pre><p>where,</p><ul>
<li>RawCounts: Raw counts returned by the <a class="el" href="group__group__adcmic__functions__dc.html#gad6e104e180e9e3c8ef195d55eddec82b">Cy_ADCMic_GetDcResult</a>.</li>
<li>Offset - the offset value, can be adjusted by the <a class="el" href="group__group__adcmic__functions__dc.html#ga463bc0f38f4c35860bc6773e04f0afed">Cy_ADCMic_SetDcOffset</a>, essentially it is a raw count value of the <a class="el" href="group__group__adcmic__enums.html#gga152671e552d2117bcc613e7021ce8514a3c094b826b2190670cbccd88af4127c1">CY_ADCMIC_REFGND</a> voltage measurement.</li>
<li>1000 - amount of millivolts in 1 volt</li>
<li>Gain: the gain value, can be adjusted by the <a class="el" href="group__group__adcmic__functions__dc.html#ga914afbd1aa02c7a38b89f3e59dc4851f">Cy_ADCMic_SetDcGain</a>, depends on DC range, essentially it is an amount of raw counts per 1 volt of input voltage.</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>This function is for DC measurement only.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">adcCounts</td><td>Conversion result from <a class="el" href="group__group__adcmic__functions__dc.html#gad6e104e180e9e3c8ef195d55eddec82b">Cy_ADCMic_GetDcResult</a></td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure <a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result in millivolts.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    result = GetResultAvg(<a class="code" href="group__group__adcmic__enums.html#gga152671e552d2117bcc613e7021ce8514a9516380d571cadb8f0032c017056f875">CY_ADCMIC_GPIO7</a>);</div><div class="line">    microvolts = <a class="code" href="group__group__adcmic__functions__dc.html#ga0f53cbec4f5114dae34c82dccd38a268">Cy_ADCMic_CountsTo_uVolts</a>(result, &amp;context);</div><div class="line">    millivolts = <a class="code" href="group__group__adcmic__functions__dc.html#gaa4e4fed5d3528ca54a9ca8d6e67bb597">Cy_ADCMic_CountsTo_mVolts</a>(result, &amp;context);</div><div class="line">    volts      = <a class="code" href="group__group__adcmic__functions__dc.html#gaae64c9203bf528b6f7f6f7edb5d25340">Cy_ADCMic_CountsTo_Volts</a> (result, &amp;context);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga0f53cbec4f5114dae34c82dccd38a268"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0f53cbec4f5114dae34c82dccd38a268">&#9670;&nbsp;</a></span>Cy_ADCMic_CountsTo_uVolts()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t Cy_ADCMic_CountsTo_uVolts </td>
          <td>(</td>
          <td class="paramtype">int16_t&#160;</td>
          <td class="paramname"><em>adcCounts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a> const *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Convert the ADC output to microvolts as an int32. </p>
<p>For example, if the ADC measured 0.534 volts, the return value would be 534000. The calculation of voltage depends on the DC range. The equation used is: </p><pre class="fragment">uV = (RawCounts - Offset) * 1000000 / Gain
</pre><p>where,</p><ul>
<li>RawCounts: Raw counts returned by the <a class="el" href="group__group__adcmic__functions__dc.html#gad6e104e180e9e3c8ef195d55eddec82b">Cy_ADCMic_GetDcResult</a>.</li>
<li>Offset - the offset value, can be adjusted by the <a class="el" href="group__group__adcmic__functions__dc.html#ga463bc0f38f4c35860bc6773e04f0afed">Cy_ADCMic_SetDcOffset</a>, essentially it is a raw count value of the <a class="el" href="group__group__adcmic__enums.html#gga152671e552d2117bcc613e7021ce8514a3c094b826b2190670cbccd88af4127c1">CY_ADCMIC_REFGND</a> voltage measurement.</li>
<li>1000000 - amount of microvolts in 1 volt</li>
<li>Gain: the gain value, can be adjusted by the <a class="el" href="group__group__adcmic__functions__dc.html#ga914afbd1aa02c7a38b89f3e59dc4851f">Cy_ADCMic_SetDcGain</a>, depends on DC range, essentially it is an amount of raw counts per 1 volt of input voltage.</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>This function is for DC measurement only.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">adcCounts</td><td>Conversion result from <a class="el" href="group__group__adcmic__functions__dc.html#gad6e104e180e9e3c8ef195d55eddec82b">Cy_ADCMic_GetDcResult</a></td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure <a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result in microvolts.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    result = GetResultAvg(<a class="code" href="group__group__adcmic__enums.html#gga152671e552d2117bcc613e7021ce8514a9516380d571cadb8f0032c017056f875">CY_ADCMIC_GPIO7</a>);</div><div class="line">    microvolts = <a class="code" href="group__group__adcmic__functions__dc.html#ga0f53cbec4f5114dae34c82dccd38a268">Cy_ADCMic_CountsTo_uVolts</a>(result, &amp;context);</div><div class="line">    millivolts = <a class="code" href="group__group__adcmic__functions__dc.html#gaa4e4fed5d3528ca54a9ca8d6e67bb597">Cy_ADCMic_CountsTo_mVolts</a>(result, &amp;context);</div><div class="line">    volts      = <a class="code" href="group__group__adcmic__functions__dc.html#gaae64c9203bf528b6f7f6f7edb5d25340">Cy_ADCMic_CountsTo_Volts</a> (result, &amp;context);</div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gaae64c9203bf528b6f7f6f7edb5d25340"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaae64c9203bf528b6f7f6f7edb5d25340">&#9670;&nbsp;</a></span>Cy_ADCMic_CountsTo_Volts()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float Cy_ADCMic_CountsTo_Volts </td>
          <td>(</td>
          <td class="paramtype">int16_t&#160;</td>
          <td class="paramname"><em>adcCounts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a> const *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Convert the ADC output to volts as a float. </p>
<p>For example, if the ADC measured 0.534 volts, the return value would be 0.534. The calculation of voltage depends on the DC range. The equation used is: </p><pre class="fragment">V = (RawCounts - Offset) / Gain
</pre><p>where,</p><ul>
<li>RawCounts: Raw counts returned by the <a class="el" href="group__group__adcmic__functions__dc.html#gad6e104e180e9e3c8ef195d55eddec82b">Cy_ADCMic_GetDcResult</a>.</li>
<li>Offset - the offset value, can be adjusted by the <a class="el" href="group__group__adcmic__functions__dc.html#ga463bc0f38f4c35860bc6773e04f0afed">Cy_ADCMic_SetDcOffset</a>, essentially it is a raw count value of the <a class="el" href="group__group__adcmic__enums.html#gga152671e552d2117bcc613e7021ce8514a3c094b826b2190670cbccd88af4127c1">CY_ADCMIC_REFGND</a> voltage measurement.</li>
<li>Gain: the gain value, can be adjusted by the <a class="el" href="group__group__adcmic__functions__dc.html#ga914afbd1aa02c7a38b89f3e59dc4851f">Cy_ADCMic_SetDcGain</a>, depends on DC range, essentially it is an amount of raw counts per 1 volt of input voltage.</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>This function is for DC measurement only.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">adcCounts</td><td>Conversion result from <a class="el" href="group__group__adcmic__functions__dc.html#gad6e104e180e9e3c8ef195d55eddec82b">Cy_ADCMic_GetDcResult</a></td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure <a class="el" href="structcy__stc__adcmic__context__t.html">cy_stc_adcmic_context_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result in volts.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    result = GetResultAvg(<a class="code" href="group__group__adcmic__enums.html#gga152671e552d2117bcc613e7021ce8514a9516380d571cadb8f0032c017056f875">CY_ADCMIC_GPIO7</a>);</div><div class="line">    microvolts = <a class="code" href="group__group__adcmic__functions__dc.html#ga0f53cbec4f5114dae34c82dccd38a268">Cy_ADCMic_CountsTo_uVolts</a>(result, &amp;context);</div><div class="line">    millivolts = <a class="code" href="group__group__adcmic__functions__dc.html#gaa4e4fed5d3528ca54a9ca8d6e67bb597">Cy_ADCMic_CountsTo_mVolts</a>(result, &amp;context);</div><div class="line">    volts      = <a class="code" href="group__group__adcmic__functions__dc.html#gaae64c9203bf528b6f7f6f7edb5d25340">Cy_ADCMic_CountsTo_Volts</a> (result, &amp;context);</div></div><!-- fragment --></dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
